Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI move check incorrect sphinx directives to pre-commit #37136

Merged
merged 7 commits into from
Oct 16, 2020

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Oct 15, 2020

Currently, the check (which uses grep with the return codes inverted) doesn't catch

    .. warning:

, while using pygrep from pre-commit (which is a Python implementation of grep with inverted return codes) does. I think this is because grep doesn't count the newline as a character

Advantages of moving this (and, later, other) invgrep checks to pre-commit are:

  • they'll be cross-platform
  • they'll be simpler to write/maintain because pre-commit comes with pygrep built-in, so there's no need to manually define something like invgrep
  • they'll give devs faster feedback on when they introduce unwanted patterns

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
@jreback jreback added Docs Code Style Code style, linting, code_checks labels Oct 16, 2020
@jreback jreback added this to the 1.2 milestone Oct 16, 2020
@jreback jreback merged commit b1dd20b into pandas-dev:master Oct 16, 2020
@jreback
Copy link
Contributor

jreback commented Oct 16, 2020

thanks @MarcoGorelli these pre-commit hooks are nifty

@MarcoGorelli MarcoGorelli deleted the incorrect-sphinx-directives branch October 16, 2020 07:26
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants